// Copyright 2013 Stephane SOPPERA
//
// This file is part of 3ds-image-uploader.
//
// 3ds-image-uploader is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// 3ds-image-uploader is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with 3ds-image-uploader.  If not, see <http://www.gnu.org/licenses/>.

mime = require('../3ds-mime.js');
assert = require('assert');

assert.deepEqual(mime.parseContentType(' multipart/mixed; boundary="simple boundary"'), 
		 {
		     type: 'multipart/mixed',
		     parameters: { 
			 boundary:'simple boundary' 
		     }
		 });
assert.strictEqual(mime.parseContentType(' multipart/mixed; boundary="simple boundary"').toString(), 
		   '{ type: "multipart/mixed", parameters: { boundary: "simple boundary" } }');
assert.deepEqual(mime.parseContentType('multipart/mixed; boundary=simple'), 
		 {
		     type: 'multipart/mixed',
		     parameters: { 
			 boundary: 'simple' 
		     }
		 });
assert.deepEqual(mime.parseContentType('text/svg+xml; charset=utf-8;u=2'), 
		 {
		     type: 'text/svg+xml',
		     parameters: {
			 charset: 'utf-8',
			 u: '2' 
		     }
		 });
assert.strictEqual(mime.parseContentType('text/svg+xml; charset=utf-8;u=2').toString(), 
		   '{ type: "text/svg+xml", parameters: { charset: "utf-8", u: "2" } }');

// var defaultContentType = 'text/plain; charset=US-ASCII';
// 'Content-Transfer-Encoding'
// maxLen = 72
